import { createSSRApp,provide,h } from "vue";
import App from "./App.vue";
import { createPinia } from 'pinia';
import ConfirmPopup from '@/components/comfirm-popup.vue'; // 全局统一的操作弹窗

uni.$showTost = function (title='加载失败！',duration=1500,mask=false) {
	// 变成异步代码，处理一些特殊页面 必须等待消息提示结束后在做操作
	return new Promise((res,rej) => {
		uni.showToast({
			title,
			mask,
			icon:'none',
			duration
		})
		setTimeout(() => {
			res(true)
		},duration)
	})
}


export function createApp() {
  const app = createSSRApp(App);
  app.use(createPinia());
   app.component('ConfirmPopup', ConfirmPopup)
  return {
    app,
  };
}
